package mongo

import (
	"flag"
)

func CommandArgs() (ip string, port int64, adminUser, adminPwd, user, pwd, db, role string) {
	// 定义命令行参数
	flag.StringVar(&ip, "ip", "", "请输入mongodb服务ip")
	flag.Int64Var(&port, "port", 0, "请输入mongodb服务port")
	flag.StringVar(&adminUser, "adminUser", "", "请输入admin账号")
	flag.StringVar(&adminPwd, "adminPwd", "", "请输入admin密码")
	flag.StringVar(&user, "user", "", "请输入要创建的mongodb用户")
	flag.StringVar(&pwd, "pwd", "", "请输入要创建的mongodb用户的密码")
	flag.StringVar(&role, "role", "", "请输入要创建的mongodb用户的角色，你可以选择 [1:read 2:readWrite]")
	flag.StringVar(&db, "db", "", "请输入要创建的mongodb用户可以操作的数据库")
	flag.Parse()
	return
}

//func CommandArgs() (ip string, port int64, user, pwd, db, role string) {
//	// 定义命令行参数
//	ip = "192.168.3.213"
//	port = 27017
//	user = "jack"
//	pwd = "jack"
//	db = "jack"
//	role = "readWrite"
//	return
//}
